﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

[Serializable]
public class WeatherSerivceEntity
{
    public string Province { get; set; }
    public string City { get; set; }
    public string Time { get; set; }
    public string ShouldSendZS { get; set; }
}

[Serializable]
public class WeatherService : ServiceBase
{
    public const int ItemPrice = 2;

    public WeatherService()
    {
        this.entities = new List<WeatherSerivceEntity>();

       // this.entities.Add(new WeatherSerivceEntity() { Province = "上海", City = "上海", Time = "9", ShouldSendZS = "Yes" });
    }

    private List<WeatherSerivceEntity> entities;

    public List<WeatherSerivceEntity> Entities
    {
        get
        {
            return this.entities;
        }
        set
        {
            this.entities = value;
        }
    }

    public List<WeatherSerivceEntity> Select()
    {
        return this.entities;
    }

    public void Update(int ListIndex, string City, string Time, string ShouldSendZS)
    {
        entities[ListIndex].Province = string.Empty;
        entities[ListIndex].City = City;
        entities[ListIndex].Time = Time;
        entities[ListIndex].ShouldSendZS = ShouldSendZS;
    }

    public void Delete(int ListIndex)
    {
        this.entities.RemoveAt(ListIndex);
    }
}